﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using QQ2564874169.Core;
using QQ2564874169.Core.IoC;
using QQ2564874169.Core.ORM;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            string data = "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559";
            string key = "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j";

            byte[] keyBytes = Encoding.UTF8.GetBytes(key);
            byte[] dataBytes = Encoding.UTF8.GetBytes(data);

            using (var hmac = new HMACSHA256(keyBytes))
            {
                byte[] hashBytes = hmac.ComputeHash(dataBytes);
                string hash = BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
                Console.WriteLine(hash);
            }

            Console.ReadLine();
        }
    }

    public class TestWatchMember : IWatchInsertAfter<Member>
    {
        public void OnInsertAfter(Member model)
        {
            Console.WriteLine(model.RegName);
        }
    }
}

